<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <%@include file="/WEB-INF/views/header.jsp" %>
    <title>微学习</title>
    <link rel="stylesheet" type="text/css" href="${base}/plugins/bootstrap4/css/bootstrap.min.css"/>


    <link rel="stylesheet" type="text/css" href="${base}/css/conversation/index.css"/>

</head>
<body>

<div class="container-fluid p-1" style="background-color: #eeeeee">
    <div class="row p-2">
        <div class="col-md-2 pr-0">
            <div class="msg_head">
                消息中心
            </div>
            <a href="${base}/conversation/index">
                <div class="msg_nav bg-default">
                    全部消息
                </div>
            </a>
            <a href="${base}/conversation/unread">
                <div class="msg_nav bg-default">
                    未读消息
                </div>
            </a>
            <a href="${base}/conversation/readed">
                <div class="msg_nav bg-active">
                    已读消息
                </div>
            </a>

        </div>
        <div class="col-md-10 pl-0">
            <div class="pl-3" style="background-color: white; height: 300px;">
                <table class="table">
                    <thead>
                    <tr>
                        <th style="">
                            &nbsp; <input type="checkbox" class="form-check-input" value="" id="select-all">
                        </th>
                        <th>消息内容</th>
                        <th>消息时间</th>
                        <th>发送者</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${convs}" var="c">
                        <tr>
                            <td style="width:20px; " class="">
                                &nbsp; <input type="checkbox" class="form-check-input" name="cons" value="${c.con_id}">
                            </td>
                            <td>
                                <c:if test="${!c.con_status}">
                                    <span name="con-status"
                                          style="display: inline-block; width:5px; height: 5px; background-color: blue; border-radius: 50%; margin-right: 10px;"></span>
                                </c:if>
                                <a onclick="showModal(this,${c.con_id})">${empty c.lastMsg?'':c.lastMsg.msg_message}</a>
                            </td>
                            <td><fmt:formatDate value="${c.con_time}"
                                                pattern="yyyy/MM/dd HH:mm:ss"></fmt:formatDate></td>
                            <td>${c.stu_id}</td>
                        </tr>
                    </c:forEach>

                    </tbody>
                </table>

                <%@include file="/WEB-INF/views/conversation/msgPage.jsp" %>
            </div>
        </div>


    </div>
</div>
<%@include file="/WEB-INF/views/footer.jsp" %>
</body>

<script src="${base}/js/conversation/index.js"></script>
</html>
